<?php

namespace app\apiadmin\model\action;

use app\apiadmin\service\statics\LiveUserGetDataService;
use app\common\utils\Res;
use MongoDB\Driver\Command;
use think\facade\Db;
use think\Model;

class ActionModel extends Model
{


    public static function getZhuJiaoInfo(){

        $data = Db::table('xh_qw_sync_user')->field('userid,name')->select();

        return $data;
    }


    public static function pageMap_userinfo($collection,$map, $findName, $offset, $limit)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMap_userinfo($map, $findName, $offset, $limit);

        return $data;
    }

    public static function live_user_info($collection,$map, $findName)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->live_user_info($map, $findName);

        return $data;
    }

    public static function pageMapCount_userinfo($collection,$map)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMapCount_userinfo($map);

        return $data;
    }

    public static function getYaoqingZhujiao($collection,$map){
        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->getYaoqingZhujiao($map);

        return $data;
    }

    public static function getYaoqingZhujiao2($collection,$map){
        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->getYaoqingZhujiao2($map);

        return $data;
    }

    public static function getJieliangZhujiao($where,$findName){

        // dump($where);die;
        $jieliangs = DB::table('xh_order_code')
        ->field($findName)
        ->alias('a')
        ->join(['xh_qw_sync_user' => 'b'], 'b.userid = a.teacher_id')
        ->where($where)->group('a.union_id')->select();

        return $jieliangs;
    }

    public static function delUserInfo($collection,$map,$update)
    {
        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->delUserInfo($map,$update);
        
        return $data;
    }

    public static function pldelUserInfo($collection,$map,$update)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pldelUserInfo($map,$update);
        return $data;
    }


    public static function getuser($collection,$map){
        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->getuser($map);

        return $data;
    }

    //邀请

        public static function pageMap_yaoqing($collection,$map, $findName, $offset, $limit)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMap_yaoqing($map, $findName, $offset, $limit);

        return $data;
    }

    public static function pageMapCount_yaoqing($collection,$map)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMapCount_yaoqing($map);

        return $data;
    }


    public static function delyaoqing($collection,$map,$update){
        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->delUserInfo($map,$update);
        
        return $data;
    }


    public static function pldelyaoqing($collection,$map,$update){
        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pldelUserInfo($map,$update);
        return $data;
    }


       //评论

       public static function pageMap_pinglun($collection,$map, $findName, $offset, $limit)
       {
   
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->pageMap_pinglun($map, $findName, $offset, $limit);

            return $data;
       }
   
       public static function pageMapCount_pinglun($collection,$map)
       {
   
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->pageMapCount_pinglun($map);

            return $data;
       }
   
   
       public static function delpinglun($collection,$map,$update){
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->delpinglun($map,$update);
            
            return $data;
       }
   
   
       public static function pldelpinglun($collection,$map,$update){
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->pldelpinglun($map,$update);
            return $data;
       }

       public static function addpinglun($collection,$map){
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->addpinglun($map);
            
            return $data;
    }

   public static function editpinglun($collection,$map,$update){
        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->editpinglun($map,$update);
        
        return $data;
    }

       //管控记录

       public static function pageMap_guankong($collection,$map, $findName, $offset, $limit)
       {
   
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->pageMap_guankong($map, $findName, $offset, $limit);

            return $data;
       }
   
       public static function pageMapCount_guankong($collection,$map)
       {
   
        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMapCount_guankong($map);

        return $data;
       }
   
   
       public static function delguankong($collection,$map,$update){

            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->delguankong($map,$update);
            
            return $data;
       }
   
   
       public static function pldelguankong($collection,$map,$update){

           $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->pldelguankong($map,$update);
            
            return $data;
       }       


              //邀约到课

              public static function pageMap_yaoyue($collection,$map, $findName, $offset, $limit)
              {
                $liveuser = new LiveUserGetDataService($collection);

                $data = $liveuser->pageMap_yaoyue($map, $findName, $offset, $limit);

                return $data;
              }

              public static function pageMapCount_yaoyue($collection,$map)
              {
          
               $liveuser = new LiveUserGetDataService($collection);
   
               $data = $liveuser->pageMapCount_yaoyue($map);
       
               return $data;
              }
          
          

    //营销操作

           public static function pageMap_yingxiao($collection,$map, $findName, $offset, $limit)
           {
       
                $liveuser = new LiveUserGetDataService($collection);

                $data = $liveuser->pageMap_yingxiao($map, $findName, $offset, $limit);

                return $data;
           }
       
           public static function pageMapCount_yingxiao($collection,$map)
           {
       
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->pageMapCount_yingxiao($map);
    
            return $data;
           }
       
       
           public static function delyingxiao($collection,$map,$update){
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->delyingxiao($map,$update);
            
            return $data;
           }
       
       
           public static function pldelyingxiao($collection,$map,$update){

            $liveuser = new LiveUserGetDataService($collection);
 
             $data = $liveuser->pldelyingxiao($map,$update);
             
             return $data;
           }


    //点击事件

    public static function pageMap_shijian($collection,$map, $findName, $offset, $limit)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMap_shijian($map, $findName, $offset, $limit);

        return $data;
    }

        //点击事件

        public static function pageMap_shijian2($collection,$map, $findName)
        {
    
            $liveuser = new LiveUserGetDataService($collection);
    
            $data = $liveuser->pageMap_shijian2($map, $findName);
    
            return $data;
        }
    
    public static function live_event($collection,$map, $findName)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->live_event($map, $findName);

        return $data;
    }

    public static function pageMapCount_shijian($collection,$map)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMapCount_shijian($map);

        return $data;
    }


    //在线记录

    public static function pageMap_jilu($collection,$map, $findName)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMap_jilu($map, $findName);

        return $data;
    }

    public static function pageMapCount_jilu($collection,$map)
    {

        $liveuser = new LiveUserGetDataService($collection);

        $data = $liveuser->pageMapCount_jilu($map);

        return $data;
    }


        //课程购买记录

        public static function pageMap_payorder($collection,$map, $findName, $offset, $limit)
        {
    
            $liveuser = new LiveUserGetDataService($collection);

                $data = $liveuser->pageMap_payorder($map, $findName, $offset, $limit);

                return $data;
        }
    
        public static function pageMapCount_payorder($collection,$map)
        {
            $liveuser = new LiveUserGetDataService($collection);

            $data = $liveuser->pageMapCount_payorder($map);

            return $data;
            
        }


                //课程购买记录  中  评论

                public static function pageMap_pinglunuser($collection,$map, $findName, $offset, $limit)
                {
            
                    $liveuser = new LiveUserGetDataService($collection);

                    $data = $liveuser->pageMap_pinglunuser($map, $findName, $offset, $limit);

                    return $data;
                }
            
                public static function pageMapCount_pinglunuser($collection,$map)
                {
            
                    $liveuser = new LiveUserGetDataService($collection);

                    $data = $liveuser->pageMapCount_pinglunuser($map);
        
                    return $data;
                }


}